import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import net.mindview.util.TextFile;

public class E25_WordsInfo3 {

	public static void main(String[] args) {
		Map<String, ArrayList<Integer>> map = new HashMap<String, ArrayList<Integer>>();
		Integer wordCount = 0;

		for (String word : new TextFile("src/E25_WordsInfo3.java", "\\W+")) {
			ArrayList<Integer> loc = map.get(word);
			if (loc == null) {
				loc = new ArrayList<Integer>();
				loc.add(++wordCount);
				map.put(word, loc);
			}else{
				loc.add(++wordCount);
				map.put(word, loc);
			}
		}
		System.out.println(map);
	}

}
